package cn.scxy.bookcity.controller;

import cn.scxy.bookcity.pojo.dto.UserLoginDTO;
import cn.scxy.bookcity.service.IUserLoginService;
import cn.scxy.bookcity.web.JsonResult;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 张正荣
 */
@RestController
@Slf4j
@Api(tags = "用户登录")
@RequestMapping("/userlogin")
public class UserLogin {
    @Autowired
    private IUserLoginService service;
    @PostMapping("/login")
    public JsonResult userLogin(UserLoginDTO userLoginDTO, HttpServletResponse response, HttpSession session){
       int i= service.userlogin(userLoginDTO,response,session);
        return JsonResult.ok();
    }
}
